import Main from '@/views/main/index'

/**
 * hideInMenu 是否显示在菜单栏
 * title 菜单栏显示标题
 * icon 图标的class class需自己自定义，详情参考 组件里的SideMenu其他icon
*/
// export const error_404= {
//   path: '/error-404',
//   name: 'error-404',
//   component: () => import('@/views/error/error_404.vue'),
// }
export const loginRouter= {
  path: '/login',
  name: 'login',
  meta: {
    hideInMenu: false,
    title: '登录',
    icon: 'md-folder'
  },
  component: () => import('@/views/Login'),
}
export const otherRouter= {
    path: '/',
    name: 'Main',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      title: '主页',
      icon: 'md-folder'
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          hideInMenu: true,
          title: '主页',
          icon: 'md-folder'
        },
        component: () => import('@/views/Home'),
      },
      {
        path: '/error-404',
        name: 'error-404',
        meta: {
          hideInMenu: true,
          title: '404',
          icon: 'md-folder'
        },
        component: () => import('@/views/error/error_404.vue'),
      },
    ]
  };

//右侧菜单导航
export const appRouter=[
  {
    path: '/SettingController',
    name: 'SettingController',
    component: Main,
    meta: {
      hideInMenu: false,
      title: '系统设置',
      icon: 'md-compass'
    },
    children: [
      {
        path: '/SettingController/AdminController',
        name: 'adminController',
        meta: {
          moduleNo:'adminList',
          hideInMenu: false,
          title: '管理员管理',
          icon: 'md-person'
        },
        component: () => import('@/views/SettingController/AdminController/AdminList')
      },
      {
        path: '/SettingController/AdminController/Insert',
        name: 'adminInsert',
        meta: {
          moduleNo:'adminInsert',
          hideInMenu: false,
          title: '管理员添加',
          icon: 'md-person'
        },
        component: () => import('@/views/SettingController/AdminController/AdminList/Insert')
      },
      {
        path: '/SettingController/AdminController/Update',
        name: 'adminUpdate',
        meta: {
          moduleNo:'adminUpdate',
          hideInMenu: true,
          title: '管理员修改',
          icon: 'md-person'
        },
        component: () => import('@/views/SettingController/AdminController/AdminList/Update')
      },
      {
        path: '/SettingController/RoleController',
        name: 'roleController',
        meta: {
          moduleNo:'roleController',
          hideInMenu: false,
          title: '管理员角色管理',
          icon: 'md-person'
        },
        component: () => import('@/views/SettingController/RoleController')
      },
      {
        path: '/SettingController/SalaryController',
        name: 'salaryController',
        meta: {
          hideInMenu: false,
          title: '薪资范围管理',
          icon: 'md-person'
        },
        component: () => import('@/views/SettingController/SalaryController')
      },
    ]
  },
  {
    path: '/error-404',
    name: 'error-404',
    component: Main,
    redirect: '/error-404',
    meta: {
      moduleNo:'test',
      hideInMenu: false,
      title: '2',
      icon: 'md-compass'
    },
  }
]
// 所有上面定义的路由都要写在下面的routers里
export const routers = [
  otherRouter,
  // error_404,
  ...appRouter,
  loginRouter,
];
